package com.unitd.base.module.api.service;

import com.unitd.base.module.api.mybatis.mapper.ApiTopicMapper;
import com.unitd.base.module.api.entity.TopicVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


@Service
public class ApiTopicService {
    @Autowired
    private ApiTopicMapper topicDao;


    public TopicVo queryObject(Integer id) {
        return topicDao.selectById(id);
    }


    public List<TopicVo> queryList(Map<String, Object> map) {
        return topicDao.selectByMap(map);
    }


    public int queryTotal(Map<String, Object> map) {
        return topicDao.queryTotal(map);
    }


    public void save(TopicVo topic) {
        topicDao.insert(topic);
    }


    public void update(TopicVo topic) {
        topicDao.updateById(topic);
    }


    public void delete(Integer id) {
        topicDao.deleteById(id);
    }
}
